﻿<!DOCTYPE html>
<html lang="en">
<#include "../include/resource-head.ftl"/>
<#assign active='configList'/>
<body>
<#include "../include/common-top.ftl"/>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
    <#include "../include/common-menu.ftl"/>
        <div class="main-content">
            <div class="page-content">
                <div class="col-xs-12">
                    <div class="row-fluid">
                        <div class="widget-box">
                            <div class="widget-header widget-header-blue widget-header-flat">
                                <h4 class="lighter">
                                    <i class="icon-edit"></i>修改文档
                                </h4>
                            </div>
                            <div class="widget-body">
                                <div class="widget-main">
                                    <div class="step-content row-fluid position-relative">
                                        <form class="form-horizontal" action="/doc/update" method="post"
                                              enctype="multipart/form-data">
                                            <input type="hidden" name="id" value="${doc.id}">
                                            <div class="form-group has-doc">
                                                <label class="col-xs-12 col-sm-3 control-label no-padding-right">文档名</label>
                                                <div class="col-xs-12 col-sm-5">
                                                    <input type="text" class="width-100" required name="name"
                                                           value="${doc.name}"/>
                                                </div>
                                            </div>
                                            <div class="form-group has-doc">
                                                <label class="col-xs-12 col-sm-3 control-label no-padding-right">文档编号</label>
                                                <div class="col-xs-12 col-sm-5">
                                                    <input type="text" class="width-100" required name="no"
                                                           value="${doc.no}"/>
                                                </div>
                                            </div>
                                        <#--<div class="form-group has-doc">
                                            <label class="col-xs-12 col-sm-3 control-label no-padding-right">所属分类</label>
                                            <div class="col-xs-12 col-sm-5">
                                                <select name="categoryid" class="width-100">
                                                <#list categoryList as item>
                                                    <option <#if item.id == doc.categoryid>selected</#if>
                                                            value="${item.id}">${item.name!}</option>
                                                </#list>
                                                </select>
                                            </div>
                                        </div>-->
                                        <#if sessionUser.type == 'admin'>

                                            <div class="form-group has-doc">
                                                <label class="col-xs-12 col-sm-3 control-label no-padding-right">所属教师</label>
                                                <div class="col-xs-12 col-sm-5">
                                                    <select name="userid" class="width-100">
                                                        <#list userList as item>
                                                            <option <#if item.id == doc.userid>selected</#if>
                                                                    value="${item.id}">${item.name!}</option>
                                                        </#list>
                                                    </select>
                                                </div>
                                            </div>
                                        </#if>

                                            <div class="form-group has-doc">
                                                <label class="col-xs-12 col-sm-3 control-label no-padding-right">上传文档</label>
                                                <div class="col-xs-12 col-sm-5">
                                                    <input type="file" class="width-100" required name="file"/>
                                                </div>
                                            </div>

                                            <div class="form-group has-doc">
                                                <label class="col-xs-12 col-sm-3 control-label no-padding-right">备注</label>
                                                <div class="col-xs-12 col-sm-5">
                                                    <textarea name="descript"
                                                              class="width-100">${doc.descript!}</textarea>
                                                </div>
                                            </div>
                                            <hr/>
                                            <div class="row-fluid wizard-actions">
                                                <button class="btn" type="reset">重置</button>
                                                <button class="btn btn-success" type="submit">提交</button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div><!-- /.page-content -->
        </div><!-- /.main-content -->
    </div><!-- /.main-container -->
</body>
<#include "../include/resource-script.ftl"/>
</html>

